import KZJRequest from '../../index'
import { TRequestDefaultResult } from '../../type'

enum Rank {
  Rankings = '/toplist', //排行榜数据
  SongsList = '/playlist/detail', //排行榜|歌单 数据
  SongsDetail = 'song/detail' // 歌曲详情
}

export function getRankings() {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Rank.Rankings
  })
}

export function getSongsListInfo(songsid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Rank.SongsList,
    showLoading: true,
    params: {
      id: songsid
    }
    // takeCookie: true
  })
}
// 用户喜欢的歌单
export function getSongsListInfoLike(songsid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Rank.SongsList,
    showLoading: true,
    params: {
      id: songsid
    },
    takeCookie: true
  })
}

export function getSongDetail(songsid: number) {
  return KZJRequest.get<TRequestDefaultResult>({
    url: Rank.SongsDetail,
    params: {
      ids: songsid
    }
  })
}
